#ifndef __ALU_CLUSTER_H__
#define __ALU_CLUSTER_H__

//ALU CLUSTER
#include "ALU_ADD.h"
#include "ALU_MUL.h"
#include "ALU_DSQ.h"
#include "ALU_DEF.h"
#include "LRF.h"

#define ALU_ADD_FU 0
#define ALU_MUL_FU 1
#define ALU_DSQ_FU 2

#define ALU_CLUSTER_ADD_SIZE 3
#define ALU_CLUSTER_MUL_SIZE 2
#define ALU_CLUSTER_DSQ_SIZE 1


class ALU_CLUSTER
{

public:
	ALU_CLUSTER();
	int   set_fu(int fu, int fu_num, int inputA, float inputFA, int inputB, float inputFB, int opCode, int regDst);
	int   get_fu(int fu, int fu_num, int& inputA, float& inputFA, int& inputB, float& inputFB, int& opCode);
	int   update(int fu, int fu_num);
	int   getOutput(int fu, int fu_num);
	float getOutputF(int fu, int fu_num); //Floating point, not supported
	int   isReady(int fu, int fu_num);
	int   isFinished(int fu, int fu_num);
	int   set_lrf(int fu, int fu_num, int lrf_entry, unsigned char value);
	int   set_lrf(int fu, int fu_num, int lrf_entry, int value);
	int   set_lrf(int fu, int fu_num, int lrf_entry, float value); //Floating point, not supported
	int   set_lrf(int fu, int fu_num, LRF* lrf);
	int   get_lrf(int fu, int fu_num, int lrf_entry, unsigned char& value);
	int   get_lrf(int fu, int fu_num, int lrf_entry, int& value);
	int   get_lrf(int fu, int fu_num, int lrf_entry, float& value); //Floating point, not supported
	LRF*  get_lrf(int fu, int fu_num);

private:
	ALU_ADD* aluc_add[ALU_CLUSTER_ADD_SIZE];
	ALU_MUL* aluc_mul[ALU_CLUSTER_MUL_SIZE];
	ALU_DSQ* aluc_dsq[ALU_CLUSTER_DSQ_SIZE];
	
	LRF*     aluc_add_lrf[ALU_CLUSTER_ADD_SIZE];
	LRF*     aluc_mul_lrf[ALU_CLUSTER_MUL_SIZE];
	LRF*     aluc_dsq_lrf[ALU_CLUSTER_DSQ_SIZE];
};

#endif /* ifndef __ALU_CLUSTER_H__ */